﻿//****************************************************************************//
//
// @File: Reporting.cs
// @Owner: lyudmilf
// @Test: 
//
// Purpose:
//
//      Class ReportDetails - used for building final report, ms report
//
// Notes:
//      
//      
//
//****************************************************************************//

using System.Text;

namespace SSAT.ATSDriver
{
    internal sealed class ReportDetails
    {
        private StringBuilder _content;

        public ReportDetails()
        {
            _content = InitializeContent(string.Empty);
        }

        public ReportDetails(ReportDetails report)
        {
            _content = InitializeContent(report.GetContent());
        }

        private static StringBuilder InitializeContent(string content)
        {
            return new StringBuilder(content);
        }

        public bool Write(string newString)
        {
            _content.AppendLine(newString);
            return true;
        }

        public bool WriteFormat(string newString, object obj)
        {
            _content.AppendFormat(newString, obj);
            _content.AppendLine();
            return true;
        }

        public string GetContent()
        {
            return _content.ToString();
        }
    }
}